using System;
using SkaldRogueLike.Main.Common;
using SkaldRogueLike.Main.Common.Enumerations;
using SkaldRogueLike.Main.Constants.Enumerations;

namespace SkaldRogueLike.Main.CellContent.Items
{
    public class Consumable : Item, IEquatable<Consumable>
    {
        public EquipOn PlaceType { get; protected set; }
        public ObjectType ObjectType { get; protected set; }
        public int Count { get; protected set; }

        public Consumable(string name, int bonus, 
            Bonus type, ObjectType obj, int count = 1, 
            string image = Styles.Consumable, Colors color = Colors.White, string description = "") :
                base(name, bonus, type, image, color, description)
        {
            ObjectType = obj;
            Count = count;
        }

        public void Add(Consumable consumable)
        {
            Count += consumable.Count;
        }

        public bool Equals(Consumable other)
        {
            return other.Name == Name &&
                   other.Mod == Mod &&
                   other.BonusType == BonusType &&
                   other.ObjectType == ObjectType;
        }
    }
}